package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.OrderDetail;


public class DALOrderDetail {
 
  OrderDetail od = new OrderDetail();
	
 SqlServerHelper ssh = new SqlServerHelper();

 
	public   ResultSet  getAll()
	{
		return   ssh.executeScalar(od.getAll());
	}
	
	public   ResultSet  getOrderDetailByID(int ID)
	{
		return  ssh.executeScalar(od.getOrderDetailByID(ID));
	}
	
	
	public int Add(com.fandy.struts.Model.OrderDetail oddetl) throws SQLException
	{
		
		return  ssh.executeNoQuery(od.Add(oddetl));
		
	}
	
	
	public   ResultSet  existOrder(com.fandy.struts.Model.OrderDetail odedetail)
	{
		return   ssh.executeScalar(od.existOrder(odedetail));
	}
	
	public int UpdateByID(int OrderID,com.fandy.struts.Model.OrderDetail odetail) throws SQLException
	{
		
		return  ssh.executeNoQuery(od.UpdateByID(OrderID, odetail));
	}
	
	public int DeleteByID(int id) throws SQLException
	{		
		return ssh.executeNoQuery(od.DeleteByID(id));
		
	}
	
	
	
}

